home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1995 November / EnigmA AMIGA RUN 02 (1995)(G.R. Edizioni)(IT)[!][issue 1995-11][Skylink CD].iso / earcd / program / misc / bgui12.lha / AmigaE / examples / dm.e < prev    next >
Text File  |  1995-05-13  |  8KB  |  148 lines

  1. ;/* Execute me to compile.
  2. ec dm
  3. quit
  4. */
  5. /*
  6. **      A small example of BGUI in Amiga E.
  7. **
  8. **      I have little knowledge of the E language so
  9. **      please forgive me if something is wrong or if
  10. **      something could have been done easier.
  11. **
  12. **      GUI stolen from the EasyGUI (dm.e) example. Sorry
  13. **      Wouter, I could not resist ;)
  14. **/
  15. OPT OSVERSION=37
  16. OPT PREPROCESS
  17.  
  18. MODULE 'libraries/bgui',
  19.        'libraries/bgui_macros',
  20.        'libraries/gadtools',
  21.        'bgui',
  22.        'tools/boopsi',
  23.        'utility/tagitem',
  24.        'intuition/classes',
  25.        'intuition/classusr',
  26.        'intuition/gadgetclass'
  27.  
  28. /*
  29. **      And were off.
  30. **/
  31. PROC main()
  32.         DEF     wd_obj, running = TRUE, rc = 0, signal
  33.  
  34.         /*
  35.         **      Open the library.
  36.         **/
  37.         IF bguibase := OpenLibrary( 'bgui.library', 37 )
  38.                 /*
  39.                 **      Create a window object.
  40.                 **/
  41.                 wd_obj := WindowObject,
  42.                         WINDOW_TITLE,           'E FileManager v0.1',
  43.                         WINDOW_RMBTRAP,         TRUE,
  44.                         WINDOW_AUTOASPECT,      TRUE,
  45.                         WINDOW_MASTERGROUP,
  46.                                 /*
  47.                                 **      A vertical master group.
  48.                                 **/
  49.                                 VGroupObject, Spacing( 4 ), HOffset( 4 ), VOffset( 4 ),
  50.                                         StartMember,
  51.                                                 HGroupObject, Spacing( 4 ),
  52.                                                         StartMember,
  53.                                                                 VGroupObject,
  54.                                                                         StartMember, ListviewObject, EndObject, EndMember,
  55.                                                                         StartMember, StringG( NIL, '', 200, 0 ), FixMinHeight, EndMember,
  56.                                                                 EndObject,
  57.                                                         EndMember,
  58.                                                         StartMember,
  59.                                                                 VGroupObject, Spacing( 2 ),
  60.                                                                         StartMember, Button( 'DF0:', 0 ), EndMember,
  61.                                                                         StartMember, Button( 'DF1:', 0 ), EndMember,
  62.                                                                         StartMember, Button( 'HD0:', 0 ), EndMember,
  63.                                                                         StartMember, Button( 'HD1:', 0 ), EndMember,
  64.                                                                         StartMember, Button( 'CD0:', 0 ), EndMember,
  65.                                                                         StartMember, Button( 'Ram:', 0 ), EndMember,
  66.                                                                         StartMember, Button( 'System:', 0 ), EndMember,
  67.                                                                         StartMember, Button( 'Work:', 0 ), EndMember,
  68.                                                                         StartMember, Button( 'E:', 0 ), EndMember,
  69.                                                                 EndObject, FixMinHeight, FixMinWidth,
  70.                                                         EndMember,
  71.                                                         StartMember,
  72.                                                                 VGroupObject,
  73.                                                                         StartMember, ListviewObject, EndObject, EndMember,
  74.                                                                         StartMember, StringG( NIL, '', 200, 0 ), FixMinHeight, EndMember,
  75.                                                                 EndObject,
  76.                                                         EndMember,
  77.                                                 EndObject,
  78.                                         EndMember,
  79.                                         StartMember,
  80.                                                 HGroupObject, Spacing( 2 ), EqualWidth,
  81.                                                         StartMember, Button( 'Parent', 0 ), EndMember,
  82.                                                         StartMember, Button( 'Copy', 0 ), EndMember,
  83.                                                         StartMember, Button( 'Move', 0 ), EndMember,
  84.                                                         StartMember, Button( 'Rename', 0 ), EndMember,
  85.                                                         StartMember, Button( 'Delete', 0 ), EndMember,
  86.                                                         StartMember, Button( 'MakeDir', 0 ), EndMember,
  87.                                                 EndObject, FixMinHeight,
  88.                                         EndMember,
  89.                                         StartMember,
  90.                                                 HGroupObject, Spacing( 2 ), EqualWidth,
  91.                                                         StartMember, Button( 'All', 0 ), EndMember,
  92.                                                         StartMember, Button( 'Clear', 0 ), EndMember,
  93.                                                         StartMember, Button( 'Toggle', 0 ), EndMember,
  94.                                                         StartMember, Button( 'Size', 0 ), EndMember,
  95.                                                         StartMember, Button( 'View', 0 ), EndMember,
  96.                                                         StartMember, Button( 'Config', 0 ), EndMember,
  97.                                                 EndObject, FixMinHeight,
  98.                                         EndMember,
  99.                                 EndObject,
  100.                         EndObject
  101.  
  102.                 /*
  103.                 **      Object created OK?
  104.                 **/
  105.                 IF wd_obj
  106.                         /*
  107.                         **      Open up the window.
  108.                         **/
  109.                         IF WindowOpen( wd_obj )
  110.                                 /*
  111.                                 **      Obtain signal mask.
  112.                                 **/
  113.                                 GetAttr( WINDOW_SIGMASK, wd_obj, {signal} )
  114.                                 /*
  115.                                 **      Poll messages.
  116.                                 **/
  117.                                 WHILE running = TRUE
  118.                                         /*
  119.                                         **      Wait for the signal.
  120.                                         **/
  121.                                         Wait( signal )
  122.                                         /*
  123.                                         **      Call uppon the event handler.
  124.                                         **/
  125.                                         WHILE ( rc := HandleEvent( wd_obj )) <> WMHI_NOMORE
  126.                                                 SELECT rc
  127.                                                         CASE    WMHI_CLOSEWINDOW
  128.                                                                 running := FALSE
  129.                                                 ENDSELECT
  130.                                         ENDWHILE
  131.                                 ENDWHILE
  132.                         ENDIF
  133.                         /*
  134.                         **      Disposing of the object
  135.                         **      will automatically close the window
  136.                         **      and dispose of all objects that
  137.                         **      are attached to the window.
  138.                         **/
  139.                         DisposeObject( wd_obj )
  140.                 ELSE
  141.                         WriteF( 'Unable to create a window object\n' )
  142.                 ENDIF
  143.                 CloseLibrary(bguibase)
  144.         ELSE
  145.                 WriteF( 'Unable to open the bgui.library\n' )
  146.         ENDIF
  147. ENDPROC NIL
  148.